#include <iostream>
#include <signal.h>
#include <unistd.h>
using namespace std;

volatile int flag = 0;

void handler(int signo)
{
    cout << "signo : " << signo << endl;
    flag = 1;
    cout << "change flag to " << flag << endl;
}

int main()
{
    signal(2, handler);
    cout << "getpid : " << getpid() << endl;
    while(!flag);
    cout << "quit nomal!" << endl;
    return 0;
}